//
//  MBProgressHUD+MPSuccessGif.m
//  MarkPlatform
//
//  Created by xiao6 on 2018/2/7.
//  Copyright © 2018年 AT. All rights reserved.
//

#import "MBProgressHUD+MPSuccessGif.h"

@implementation MBProgressHUD (MPSuccessGif)

- (void)hideWithSuccessGif:(MBProgressHUDCompletionBlock)completion {
    NSMutableArray *images = [NSMutableArray array];
    for (int i = 0; i < 100; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"success%05d", i]];
        if (!image) {
            break;
        }
        [images addObject:image];
    }
    UIImage *image = [UIImage animatedImageWithImages:images duration:images.count * 0.1];
    self.bezelView.color = [UIColor clearColor];
    [self hideWithMessage:nil image:image animated:YES delay:images.count * 0.1 completion:completion];
}
@end
